The Synchronize to Database feature allows you to compare a model with an existing database or schema, states the differences between their structures, and offers synchronizing the structures in model to the target connection.
Navicat provides a step-by-step wizard for you to complete the task:
Choose File -> Synchronize to Database.
Select the synchronization type.
Select the target connection from existing connections.
Select the source databases, schemas, tables or views.
Select the compare and execution options.
Click Compare to generate a set of scripts that show the differences between source and target objects.
Select the scripts you want to run.
Click Run.
Sync with selected schemas
Set the synchronization to work on all objects in the selected schemas.
Sync with selected objects
Set the synchronization to work on the selected objects only.
In this step, choose a target connection from the existing connections.
In this step, choose one or more schemas or objects in model to compare to the target schemas or objects. If objects in model are from existing schemas, you can select the existing schemas. Otherwise, enter a target schema name in Define the default schema name for comparison for the source model objects to compare to.
Note: The following options depend on the diagram database type you are chosen and sort in ascending order.
Compare auto increment value
Check this option if you want to compare the auto increment values of tables.
Compare character set
Check this option if you want to compare the character sets of tables.
Compare checks
Check this option if you want to compare checks.
Compare collation
Check this option if you want to compare the collations of tables.
Compare definers
Check this option if you want to compare the definers of views.
Compare excludes
Check this option if you want to compare excludes.
Compare foreign keys
Check this option if you want to compare table foreign keys.
Compare in case sensitive
Check this option if you want to compare table identifier with case sensitive option.
Compare indexes
Check this option if you want to compare indexes.
Compare primary keys
Check this option if you want to compare table primary keys.
Compare rules
Check this option if you want to compare rules.
Compare tables
Check this option if you want to compare tables.
Compare triggers
Check this option if you want to compare triggers.
Compare uniques
Check this option if you want to compare uniques.
Compare views
Check this option if you want to compare views.
Continue on error
Ignore errors that are encountered during the synchronization process.
SQL for objects to be changed
Check this option to include all related SQL statements if database objects will be changed in the target.
SQL for objects to be created
Check this option to include all related SQL statements if new database objects will be created in the target.
SQL for objects to be dropped
Check this option to include all related SQL statements if database objects will be dropped from the target.
The Model Objects and Database Objects views show the differences between model and database/schema objects after the comparison of their structures, providing with the detailed SQL statements shown in the Result list.
The red item represents the non-existence for the other database/schema. The blue item represents the existence for the other database/schema, but different definition detected.
All the scripts are unchecked in the Result list by default. Check the scripts you want to apply to the target.
To view the full SQL statement, move mouse cursor hovers over a statement.
Click the Run button to execute the selected query.